<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="mvc" uri="http://www.springframework.org/tags/form" %>
<%@taglib prefix="fmt" uri="http://www.springframework.org/tags" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>档案查询</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=10,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.0">
    <link rel="stylesheet" type="text/css" href="../../../css/sys/userInfor.css"/>
    <link rel="stylesheet" type="text/css" href="../../../css/hr/index.css"/>
    <script src="../../../js/jquery/jquery-1.9.1.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/base/base.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/sys/userInfor.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../lib/laydate/laydate.js"></script>
    <script src="../../../lib/jquery.form.min.js"></script>
    <script src="../../lib/pagination/js/jquery.pagination.min.js" type="text/javascript" charset="utf-8"></script>

    <style>
        html,body{
            height:100%;
        }
        .btn_{
            width:300px;display: block;
        }
        .leave_send{
            display: inline-block;
            float: left;
            width: 66px;
            height: 30px;
            margin-right: 0px;
            margin-top: 10px;
            margin-bottom: 20px;
            background: url(../../../img/publish.png) no-repeat;
            padding-left: 47px;
            padding-top: 7px;
            cursor: pointer;
            font-size: 14px;
        }
        #downChild .dpetWhole0 .childdept{
            padding-left: 60px!important;
        }
        #downChild .dpetWhole0 ul .childdept{
            padding-left: 80px!important;
        }
        #downChild .dpetWhole0 ul ul li .childdept{
            padding-left: 95px!important;
        }
        .left {
            width: 207px;
            border-right: 1px solid #ccc;
            overflow-y: auto;
        }
        .rig {
            width: 78%;
        }
        .colorDis{
            background-color: #e7e7e7;
        }
        table input{
            width: auto;
        }
        .allCondition{
            width: 1200px;
            margin-left: 20px;
        }
            /*.biaoge{  border:1px solid red;  border-collapse:collapse;}*/
        /*.biaoge tbody tr td{ border:1px solid red; }*/
        .text_width{width:126px;}
        .loopData{
            font-size: 11pt;
        }



        table.TableBlock tr td:nth-child(2){
            width: 35%;
        }

        /**
        寇义东
        2018.08.01
         */
        #queryArchives, #mans{
            height: 35px;
            line-height: 35px;
            cursor: pointer;
        }

        .queryArchivesTitle, .mansTitle{
            display: inline-block;
        }
        .queryArchivesIcon, .mansIcon{
            padding-left: 10px;
        }
        .rig{
            width: 84.9%;
            height: 98%;
            overflow-y: inherit;
        }
        .headli1_1 {
            padding: 0px 10px;
            display: inline-block;
            text-align: center;
        }
        .headli1_2 {
            width: 2px;
            margin-left: 26px;vertical-align: middle;
            clear: both;

        }
        .top_box{
            height:45px;
        }
        .cont{
            overflow: hidden;
        }
        .zaizhi{
            height: 100%;
            /*display: inline-block;*/
        }

    </style>
    <script>
        function newtime(val) {
//            console.log($(val).val())
            var date = new Date($(val).val());
            // 有三种方式获取
            var time1 = date.getTime();

            var datanew=new Date();


        }

    </script>
</head>
<body>

    <div class="cont">
        <div class="top_box">
            <div class="headDiv">
                <ul class="main_title">
                    <li data-num="0" class="item1"><span class="headli1_1">在职人员</span><img class="headli1_2" src="../../img/twoth.png" alt=""></li>
                    <li data-num="1" class="item2"><span class="headli1_1 title_on">离职人员</span><img class="headli1_2" src="../../img/twoth.png" alt=""></li>
                </ul>
            </div>
        </div>
        <div class="left">
            <div class="collect">
                <div id="incum" class="divUP">
                    <div id="queryArchives">
                        <i class="queryArchivesIcon">
                            <img src="/img/hr/ar.png" alt="">
                        </i>
                        <span class="queryArchivesTitle">查询/导出离职人员档案</span>
                    </div>
                    <div id="mans">
                        <i class="mansIcon">
                            <img src="/img/hr/ar.png" alt="">
                        </i>
                        <span class="mansTitle">已记录所属部门</span>
                    </div>
                    <div id="downChild" style="display:none;">
                        <div class="pickCompany">
                            <span style="height:35px;line-height:35px;" class="childdept">
                                <img src="/img/commonTheme/${sessionScope.InterfaceModel}/icon_company.png" alt="" style="vertical-align: middle;width: 15px;margin-right: 10px;margin-left: 13px;margin-bottom: 4px;">
                                <a href="javascript:void(0)" class="dynatree-title" title="" style="color: #000;"></a>
                            </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="zaizhi">
            <%--人事档案查询--%>
            <div class="rig rigIframe" style="display: block">
                <iframe src="/hr/query/Query" frameborder="0" width="100%" height="100%"></iframe>
            </div>
            <%--基本信息--%>
            <div class="rig rigInfo" style="display: none">
                <iframe  id="infoIframe" src="" frameborder="0" width="100%" height="100%"></iframe>
            </div>
        </div>


    </div>


<script>
    $(function () {
        var widthCont=$('.cont').width()-208;
        $('.rig').width(widthCont);
        // 点击左侧列表标题切换图标
        $('#mans').on('click', function (){
            var temp = $('.mansIcon img').attr('src');
            if(temp == '/img/hr/ar.png'){
                $('.mansIcon img').attr('src', '/img/hr/arrow_d.png');
                $('#downChild').css('display', 'block');
            }else{
                $('.mansIcon img').attr('src', '/img/hr/ar.png');
                $('#downChild').css('display', 'none');
            }
            $('.rigInfo').css('display', 'block');
            $('.rigIframe').css('display', 'none');
        })
        $('#queryArchives').on('click', function () {
            $('.rigIframe').css('display', 'block');
            $('.rigInfo').css('display', 'none');
        })


        $('#department').deptSelect();
        $('#selectUser').privSelect();
        $.loadSidebar2($('#downChild'),0, function (el) {
            $.loadSidebar2(el, 30)
        })
        loadSidebar1($('#downChild'),0)


        // 加载下拉列表的每一项
        function loadSidebar1(target,deptId) {
            $.ajax({
                url: '/department/getChDeptfq',
                type: 'get',
                data: {
                    deptId: deptId
                },
                dataType: 'json',
                success: function (data) {
                    var str = '';
                    data.obj.forEach(function (v, i) {
                        if (v.deptName) {
                            str += '<li><span data-types="1"  data-numtrue="1" ' +
                                'onclick= "imgDown4(' +v.deptId + ',this)"  style="height:35px;line-height:35px;padding-left: 30px" deptid="' + v.deptId + '" class="firsttr childdept"><span class=""></span><img src="/img/sys/dapt_right.png" alt="" style="margin-left: 12px;width: 8px;height: 14px;margin-top: -3px;margin-right: 4px;"><a href="javascript:void(0)" class="dynatree-title" title="' + v.deptName + '">' + v.deptName + '</a></span><ul style="display:none;" class="dpetWhole0"></ul></li>';
                        }
                    })
                    widthnum++;
                    target.append(str);
                }
            })
        }

        // 设置左侧下拉列表标题
        $.ajax({
            url:'/sys/showUnitManage',
            type:'get',
            dataType:"JSON",
            data : '',
            success:function(obj){
                var data = obj.object.unitName;
                $('#downChild .pickCompany .dynatree-title').text(data).attr('title',data);

            },
            error:function(e){
            }
        })



    });


    /*人员接口*/
    function clickrenwu (id,me) {
        // $('#add_send').attr('ac', 'edit');
        // $(".leave_send").show();//离职按钮显示
        // $('.table_personDetail').show().siblings().hide();
        //
        // $('.rigInfo').css('display', 'block')
        //
        // $('.rigIframe').css('display', 'none');
        // $("#showImage").html("");
        // var data = {
        //     'uid': id
        // }
        //
        // // 将id传到ifranme上
        // var srcStr = $('.rigInfo iframe').attr('src'); //
        // if(srcStr.indexOf('?') != -1){
        //     srcStr = '/hr/query/showInfo';
        // }
        // var srcData = '?uid='+data.uid;
        // var newSrc = srcStr + srcData;
        // $('.rigInfo iframe').attr('src','/hr/query/showInfo');
        // $('.rigInfo iframe').attr('src', newSrc);
        $('.rigIframe').hide();
        $('.rigInfo').show()
        $('#infoIframe').attr('src','/hr/query/details?staffId='+id+'&types=0');
    }

    var deptNameShow = "";
    var deptIdShow = "";
    /*部门接口*/
    function ajaxdata(deptNumId, me) {//部门
        deptIdShow = deptNumId;
        deptNameShow = $(me).find('a').text();
        $('.loopData').remove();
        $('.childQuery').show().siblings().hide();
        var data = {
            'deptId': deptNumId
        };
        $.ajax({
            type: 'get',
            url: '<%=basePath%>hr/api/queryCountNoDocument',
            dataType: 'json',
            data: data,
            success: function (res) {
                var count = res.totleNum;
                $(".no_perCount").html(count);
            }
        })
    }


    /*切换*/
    $('.main_title li').click(function () {
        $(this).find('span').addClass('title_on').parent().siblings().find('span').removeClass('title_on');
        var dataNum = $(this).attr('data-num');
        if (dataNum == 0) {
            window.location.href = '/hr/query/Management';
        } else if (dataNum == 1) {
            window.location.href = '/hr/query/selectLZ';
        }
    });
</script>
</body>
</html>

